{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f6308a7e-0b63-4582-bc3f-06f0a901107c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.5.1'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import torch\n",
    "torch.__version__\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "78e03a2f-8f1d-4468-a197-90cf86de9cc3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "interest_score = np.random.randint(10, size=(4, 3))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "80021154-8f8f-48fc-9944-1062978b8f72",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([11, 13, 32])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(interest_score, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "dc46d4e9-d408-4ae4-abc7-8b46f43d6851",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[[11 13  3]\n",
      "  [16  7  1]]\n",
      "\n",
      " [[ 0 10  5]\n",
      "  [ 8 15  2]]\n",
      "\n",
      " [[ 9 14  6]\n",
      "  [17  4 12]]]\n",
      "[[0 1 1]\n",
      " [0 0 1]\n",
      " [0 1 0]]\n"
     ]
    }
   ],
   "source": [
    "arr = np.arange(18)\n",
    "np.random.shuffle(arr)\n",
    "arr = arr.reshape(3, 2, 3)\n",
    "# argmin(求最小值下标),argmax(求最大值下标)\n",
    "print(arr)\n",
    "print(arr.argmin(axis=1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "84f741b4-1ab9-4452-ad27-d28a30d00718",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 0 0]\n",
      " [1 1 0]\n",
      " [1 0 1]]\n"
     ]
    }
   ],
   "source": [
    "print(arr.argmax(axis=1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "417c034d-10b7-4d32-a294-3bc325522f6d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
